/********************************
 *版权所有 CopyRight(c) 快程乐码信息有限公司所有，未经授权，不得复制、转发
 */
package com.yjx.test.dozer.entity;

import org.dozer.Mapping;

import java.util.Objects;

/************
 *@Author yejx
 *@version v1.0
 *@create 2020/6/30 17:09
 *@Description TODO
 *
 */
public class Student implements Comparable {
    @Mapping("name")
    private String stuName;

    public Student() {
    }

    public String getStuName() {
        return stuName;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public Student(String stuName) {
        this.stuName = stuName;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("C{");
        sb.append("stuName='").append(stuName).append('\'');
        sb.append('}');
        return sb.toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return Objects.equals(stuName, student.stuName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(stuName);
    }

    @Override
    public int compareTo(Object o) {
        if (o.hashCode() > this.hashCode()) {
            return 1;
        } else {
            return 0;
        }
    }
}
